package mutsumimod.cards.deprecated;

import basemod.AutoAdd;
import com.megacrit.cardcrawl.actions.common.MakeTempCardInHandAction;
import com.megacrit.cardcrawl.cards.AbstractCard;
import com.megacrit.cardcrawl.characters.AbstractPlayer;
import com.megacrit.cardcrawl.monsters.AbstractMonster;
import mutsumimod.cards.BaseCard;
import mutsumimod.character.Mutsumi;
import mutsumimod.util.CardStats;

@Deprecated
@AutoAdd.Ignore
public class ONeiGaiUtil extends BaseCard implements NotRecordCard {
    public static final String ID = makeID(ONeiGaiUtil.class.getSimpleName());

    public AbstractCard anotherCard = null;

    public static final CardStats info = new CardStats(
            Mutsumi.Meta.CARD_COLOR,
            CardType.SKILL,
            CardRarity.UNCOMMON,
            CardTarget.SELF,
            1
    );

    public ONeiGaiUtil() {
        super(ID, info);
        setAttr(0,0,1);
        setAttrUpg(0,0,1);
        setShouldCopyUse(true);
    }

    @Override
    public void beforeCopy(){
        clearCopyCardsAddSelf();
    }

    @Override
    public void use(AbstractPlayer p, AbstractMonster m) {
        if(anotherCard != null) {
            for(int i=0;i<magicNumber;i++) {
                addToBot(new MakeTempCardInHandAction(anotherCard.makeStatEquivalentCopy()));
            }
        }
    }

    @Override
    public AbstractCard makeCopy() { //Optional
        return new ONeiGaiUtil();
    }

    @Override
    public void updateDescription() {
        if(getInCopyUse()&&anotherCard!=null){
            rawDescription=cardStrings.EXTENDED_DESCRIPTION[0]+anotherCard.name+cardStrings.EXTENDED_DESCRIPTION[1];
        }else{
            rawDescription = cardStrings.DESCRIPTION;
        }
        initializeDescription();
    }

    @Override
    public ONeiGaiUtil makeStatEquivalentCopy(){
        ONeiGaiUtil card=(ONeiGaiUtil) super.makeStatEquivalentCopy();
        card.anotherCard=anotherCard;
        return card;
    }
}